<script>
export default {
  globalData: {
    // 获取全局变量
    //  const app = getApp();
    // console.log(app.globalData.appName); // 输出: My UniApp

    // // 修改全局变量
    // app.globalData.userToken = '123456';

    userInfo: {
      id: '0',
      username: ''
    },
    isLoggedIn: false,
    header: {
      Authorization: ''
    },
    orderInfo: null,
    payId: 0
  },

  onLaunch: async function () {
    this.globalData.header.Authorization = uni.getStorageSync('token')
    const infoJson = uni.getStorageSync('userInfo')
    if (infoJson.length === 0 || infoJson === '') {
      this.globalData.userInfo.id = '0'
    } else {
      this.globalData.userInfo = JSON.parse(infoJson)
    }
  },
  onShow: async function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  }
}
</script>

<style lang="scss">
/*每个页面公共css */

/* 隐藏滚动条 */
::-webkit-scrollbar {
  display: none;
}

.view {
  max-width: 100vw;
  min-height: 100vh;
  background-color: $uni-bg-color-grey;
  padding-bottom: 50upx;
  overflow-x: hidden;
  position: relative;
}

.view::after {
  content: '~~~~到底咯~~~~';
  position: absolute;
  bottom: 20upx;
  left: 0%;
  width: 100%;

  text-align: center;
  font-size: 25upx;
  color: #c0c4cc;
}

.page-mask {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0%;
  left: 0%;
  background-color: rgba($color: #000000, $alpha: 0.4);
  transition: all 0.5s ease-in-out;
  z-index: 20;
}

.page-mask-show {
  opacity: 1;
  pointer-events: auto;
}

.page-mask-hidden {
  opacity: 0;
  pointer-events: none; /* 禁用交互，模拟 display: none */
}

.c-wrapper {
  padding: $def-padding;
  margin-bottom: $def-margin;
  background-color: #fff;
  box-sizing: border-box;
  width: 100%;
  box-shadow: $def-shadow;
}

radio {
  transform: $def-radio-size;
}
</style>
